<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>Alterar Função</title>
		<s:url value="/css/style.css" var="cssStyle"></s:url>
		<link rel="stylesheet" type="text/css" href="${cssStyle}" media="screen">
		<script type="text/javascript">
		$(document).ready(function(){
			$(".confirm").click(function(){
   				var nome  = $("#idNome").val();
 				if(!nome==""){
 					if(!confirm("Confirma Alteração da função: "+nome+"?")){
						$("#loading").hide();
						$(".loadingImage").CenterIt();
						$(".loadingImage").hide();	      					
      					return false;
   					}
   				}
			});
			$("#idForm").submit(function(){
				var nome  = $("#idNome").val();
				if(nome==""){
					$("p").show().hide();
					$("#idNome").after("<p style='color:red;'>Nome é obrigatório.</p>");
					$("#loading").hide();
					$(".loadingImage").CenterIt();
					$(".loadingImage").hide();						
					return false;
				}else{
					$("p").show().hide();
				}
			});
		});
		</script>
	</head>
	<body>		
		<s:form action="alterar-funcao" namespace="/" method="POST" id="idForm">
			<s:hidden name="altFuncao.id"></s:hidden>
			<s:textfield label="Funcao" name="altFuncao.nmfuncao" disabled="true" id="idNome"/>
			<s:textarea label="Descricao" name="altFuncao.descricao" rows="4"/><br/>
			<input value="Alterar" type="submit" class="confirm, botao">
			<input type="submit" onclick="window.history.go(-1)" value="Cancelar" class="botao"/>
		</s:form>
	</body>
</html>
